import React, {Component} from 'react';
import {Router, Route, Switch} from 'react-router-dom';

// 历史记录
import history from './modules/public/history'

// 路由配置
import routes from './route/index'

const RouteWithSubRoutes = route => {
	return (<Route path={route.path} exact component={route.component.default}></Route>)
};

class App extends Component {
	constructor(props) {
		super(props)
		this.state = {
			isExact: true
		}
	}
	render() {
		return (<Router history={history}>
			<div>
				{routes.map((route, i) => <RouteWithSubRoutes key={i} {...route}/>)}
			</div>

		</Router>);
	}
}

export default App;
